package cn.wolfcode.cms.mapper;

import cn.wolfcode.cms.domain.Employee;
import cn.wolfcode.cms.query.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int queryForCount(EmployeeQueryObject qo);

    List<Employee> queryForList(EmployeeQueryObject qo);

    void changeState(Long id);

    //维护与角色关系
    void insertRelation(@Param("empId") Long id,
                        @Param("roleId") Long roleId);

    //删除与角色关系
    void deleteRelation(Long id);

    Employee getEmployeeByName(String username);
}